package com.company.threads;

/**
 * @author xiaohutu
 * @Description: 输出线程名字
 * @date 2021/1/1510:16
 */
public class ThreadB {
    public static void main(String[] args) {
        System.out.println(Thread.currentThread().getName());
        for (int i = 0; i < 10; i++) {
            new Thread("" + i) {
                @Override
                public void run() {
                    System.out.println(getName() + "running");
                }
            }.start();

        }
    }
}
